package com.gm.app.model;

import java.util.Calendar;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.codehaus.jackson.map.annotate.JsonView;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.serializable.RooSerializable;
import org.springframework.roo.addon.tostring.RooToString;

import com.gm.app.jackson.Views.Public;

@RooJavaBean
@RooToString
@RooEntity(table = "visits")
@RooSerializable
public class Visit {

	@Temporal(TemporalType.TIMESTAMP)
	@DateTimeFormat(style = "S-")
	
	private Calendar visitDate;

	
	private String comments;

	
	private String tag;

	@ManyToOne(cascade={CascadeType.DETACH,CascadeType.REFRESH,CascadeType.PERSIST,CascadeType.MERGE})
	private Register registry;
	
	@ManyToMany
	private List<Publisher> publisher;
}
